static int in_icon;
static int in_urlname;
static int in_gs_type;
+static int in_gs_name;
static int in_gs_container;
static int in_gs_diff;
static int in_gs_terr;
static FILE *ofd;
static void *mkshort_handle;
+static char *gsshortnames = NULL;
+
#define MYNAME "GPX"
#define MY_CBUF 4096
in_something_else++;
start_something_else( el, attr );
}
+ else if (strcmp(el, "groundspeak:name") == 0) {
+ in_gs_name++;
+ in_something_else++;
+ start_something_else( el, attr );
+ }
else if (strcmp(el, "groundspeak:container") == 0) {
in_gs_container++;
in_something_else++;
if (in_name && in_wpt) {
wpt_tmp->shortname = xstrdup(cdatastr);
}
- if (in_desc && in_wpt) {
- wpt_tmp->notes = xstrdup(cdatastr);
+ if (gsshortnames) {
+ if (in_gs_name && in_wpt) {
+ wpt_tmp->notes = xstrdup(cdatastr);
+ }
+ } else {
+ if (in_desc && in_wpt) {
+ wpt_tmp->notes = xstrdup(cdatastr);
+ }
}
if (in_cmt && in_wpt) {
wpt_tmp->description = xstrdup(cdatastr);
in_gs_type--;
in_something_else--;
end_something_else();
+ } else if (strcmp(el, "groundspeak:name") == 0) {
+ in_gs_name--;
+ in_something_else--;
+ end_something_else();
} else if (strcmp(el, "groundspeak:container") == 0) {
in_gs_container--;
in_something_else--;
(in_wpt && in_url) ||
(in_wpt && in_urlname) ||
(in_wpt && in_gs_type) ||
+ (in_wpt && in_gs_name) ||
(in_wpt && in_gs_container) ||
(in_wpt && in_gs_diff) ||
(in_wpt && in_gs_terr) ||
fprintf(ofd, "</gpx>\n");
}
+static
+arglist_t gpx_args[] = {
+ { "gsshortnames", &gsshortnames, "Prefer shorter descriptions from Groundspeak files"},
+ { 0, 0, 0}
+};
+
ff_vecs_t gpx_vecs = {
gpx_rd_init,
gpx_wr_init,
gpx_wr_deinit,
gpx_read,
gpx_write,
+ gpx_args,
};